<?php

if ($getInfo[hunger_level] >= "10")
{
	die("
		<br><center>
		<table width=380 cellspacing=0>
		<tr>
		<td bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Selected Item</font></b></center>
		</td>
		<td width=300 bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Item Details</font></b></center>
		</td>
		</tr>
		<tr height=100>
		<td valign=middle>
		<p align=center><img src=images/user_images/opg_$game/items/item_$find_item2[id].gif>
		<br>
		<b>$find_item2[item_name]</b>
		</td>
		<td width=300>
		<p 	align=center>You are too full to eat the $find_item2[item_name].<br>($find_item[parts_left]/$find_item2[parts] Parts Left)<br><a href=myitems.php?game=$game>Back to Items</a></p>
		</td>
		</tr>
		</table>
		</center>
	");
}

$new_hunger = $getInfo[hunger_level] + $find_item2[magic_num];

mysql_query("UPDATE members2 SET hunger_level=$new_hunger WHERE username = '$username' AND game = '$game'");

if ($find_item[parts_left] <= 1)
{
	mysql_query("DELETE FROM usersitems2 WHERE id = '$id' AND owner = '$userid' AND game = '$game'");
}
else
{
	mysql_query("UPDATE usersitems2 SET parts_left=$find_item[parts_left]-1 WHERE owner = '$userid' AND id = '$id' AND game = '$game'");
}

$minus1 = $find_item[parts_left] - 1;
print "
		<br><center>
		<table width=380 cellspacing=0>
		<tr>
		<td bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Selected Item</font></b></center>
		</td>
		<td width=300 bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Item Details</font></b></center>
		</td>
		</tr>
		<tr height=100>
		<td valign=middle>
		<p align=center><img src=images/user_images/opg_$game/items/item_$find_item2[id].gif>
		<br>
		<b>$find_item2[item_name]</b>
		</td>
		<td width=300>
		<p 	align=center>You have eaten the $find_item2[item_name].<br>You feel slightly less hungry now!<br>($minus1/$find_item2[parts] Parts Left)<br><a href=myitems.php?game=$game>Back to Items</a></p>
		</td>
		</tr>
		</table>
		</center>
";
?>